{template 'common/header'}

<div class="main">
    <ul class="nav nav-tabs">
        <li ><a href="{php echo $this->createWebUrl('zjpManage');}">活动管理</a></li>

        <li > <a href="{php echo $this->createWebUrl('play_user',array('zid'=>$zid));}">参加用户管理</a></li>

        <li class="active" > <a href="{php echo $this->createWebUrl('zjRecordList',array('zid'=>$zid));}">抓奖记录</a></li>


    </ul>





    <div class="panel panel-info">
        <div class="panel-heading"></div>
        <div class="panel-body">
            <form action="./index.php" method="post" class="form-horizontal" role="form">

                <input type="hidden" name="a" value="entry" />
                <input type="hidden" name="c" value="site" />
                <input type="hidden" name="m" value="{MON_ZJP}" />
                <input type="hidden" name="do" value="zjRecordList" />
                <input type="hidden" name="zid" value="{$zid}" />

                <div class="form-group">
                    <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">关键字</label>
                    <div class="col-sm-8 col-lg-9">
                        <input class="form-control" name="keywords" id="" type="text" value="{$_GPC['keywords']}" placeholder="可查询手机号">
                    </div>

                </div>


                <div class="form-group">
                    <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">中奖奖品</label>
                    <div class="col-sm-8 col-lg-9">
                        <select name="pid" class="form-control" style="float:left">
                            <option value="0"> 全部</option>

                            {loop $prizes $pr}
                                <option value="{$pr['id']}" {if $pid==$pr['id']}selected='selected'{/if}>{$pr['pname']}</option>
                            {/loop}

                        </select>
                    </div>
                    <div class=" col-xs-12 col-sm-2 col-lg-2">
                        <button class="btn btn-default"><i class="fa fa-search"></i> 搜索</button>
                    </div>
                </div>
            </form>
        </div>

    </div>



    <div style="padding: 0 15px 0  15px;">
        <div class="row-fluid">
            <div class="span8 control-group">
                <a class="btn btn-default" href="{php echo $this->createWebUrl('zjdownload',array('zid'=>$zid))}"><i class="icon-download-alt"></i>导出抽奖信息</a>
                <a class="btn btn-default" href="{php echo $this->createWebUrl('zjRecordList',array('zid'=>$zid))}">全部</a>
                <a class="btn btn-default" href="{php echo $this->createWebUrl('zjRecordList',array('zid'=>$zid,'status'=>0))}">未中奖</a>
                <a class="btn btn-default" href="{php echo $this->createWebUrl('zjRecordList',array('zid'=>$zid,'status'=>1))}">已中奖</a>
                <a class="btn btn-default" href="{php echo $this->createWebUrl('zjRecordList',array('zid'=>$zid,'status'=>2))}">已领奖</a>

            </div>
        </div>

    </div>







    <div class="panel panel-default">
        <div class="table-responsive panel-body">


            <table class="table table-hover">
                <thead>
                <tr>
                    <th style="width:120px;">昵称</th>
                    <th style="width:100px;">头像</th>
                    <th style="width:100px;">手机号</th>

                    <th style="width:100px;">抽奖时间</th>

                    <th style="width:100px;">奖品</th>
                    <th style="width:100px;">状态</th>

                    <th style="width:110px;">操作</th>
                </tr>
                </thead>
                <tbody>


                {loop $list $row}
                <tr>
                    <td>{$row['nickname']}</td>
                    <td><img src="{$row['headimgurl']}" width="50px" height="50px"></td>
                    <td>{$row['tel']}</td>
                    <td>{php echo date("Y-m-d H:i",$row['createtime'])}</td>
                    <td>{$row['pname']}</td>

                    <td>{if $row['award_status']==0}未中奖{/if}{if $row['award_status']==1}已中奖{/if}{if $row['award_status']==2}已领奖{/if}</td>


                    <td >

                        {if $row['award_status']==1}
                        <a  class="btn btn-default" href="{php echo $this->createWebUrl('zjRecordList', array( 'id' => $row['id'], 'op' => 'lq'))}"
                           onclick="return confirm('确认用户领取次奖品？');return false;" title="领取"
                           class="btn btn-small">领取{$row['pname']}</a>
                        {/if}


                        <a href="{php echo $this->createWebUrl('zjRecordList', array( 'id' => $row['id'], 'op' => 'delete'))}"
                           onclick="return confirm('此操作不可恢复，确认删除？');return false;" title="删除"
                           class="btn btn-small"><i class="glyphicon glyphicon-remove"></i>删除</a>
                    </td>
                </tr>
                {/loop}


                </tbody>


            </table>
            {$pager}
        </div>
    </div>










</div>





{template 'common/footer'}